Skip to content

fix(id/web): validate /api/world/host-view + /api/world/invite payload shapes - #7840

Closed
developing-today[bot] wants to merge 1 commit into
mainfrom
queue/14007-7831-world-shape-validation
Closed

developing-today[bot] wants to merge 1 commit into
mainfrom
queue/14007-7831-world-shape-validation

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #7831

world.ts bare-cast both HTTP responses while the WebSocket frames in the same file are carefully guarded. A wrong-shape 200 leaked a raw TypeError as the host-view status, and for invite it persisted the literal string "undefined" as the join capability in sessionStorage while reporting success.

This validates both payloads at the fetch boundary against the world_ws.rs contracts (HostViewResponse: numeric records_sequence, object records, string-or-null next_after, guarded snapshot/view when present; invite: non-empty string capability + display_name) and fails closed through the handlers own error vocabulary ("Host view unavailable" / "Invite failed"). New regression suite world-shape.test.ts covers the malformed cases from #7831 (18 tests).

Tests: world-shape.test.ts 18/18 pass; world-rejoin.test.ts 3/3 pass; tsc --noEmit clean. Full web suite run under extreme laptop load showed only the known pre-existing search-panel failure plus load-timeout flakes in the new file, since hardened with explicit 30s test timeouts and re-verified green standalone.

Queue note: task 14007 was claimed by lane code-t; its lease expired during long test runs, lane code-m re-claimed, found this work in progress, and parked the task with the resume condition that the owning session opens this PR. The resuming lane can merge under the standing criteria once Codex/CI disposition is recorded.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 8, 2026 23:01
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 901605f2-d498-47d3-8284-fcbe05ff3bb6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

dezren39 pushed a commit that referenced this pull request Nov 9, 2026
…cases (#7831)

Fold the surviving cases from the superseded PR #7840 into #7858: a numeric records_sequence and a non-record surface are rejected, and an empty or non-string display_name now fails the invite door along with a missing one. Adds the three corresponding regression cases.
@dezren39

dezren39 commented Nov 9, 2026

Copy link
Copy Markdown
Member

Superseded by #7858, which is now the combined fix for #7831. This PR's surviving cases (numeric records_sequence, non-record surface, empty/non-string display_name) were folded into #7858's world-shape.test.ts and guard; #7858 passed the targeted suite (21/21), tsc --noEmit, and the full web suite (706 passed, only the known pre-existing search-panel aria-label failure). No work from this PR is lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant